package com.ddyx.service.product.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * <p>
 * 商品属性选项
 * </p>
 *
 * @author agula
 * @since 2019-08-06
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("p_goods_spec_value")
public class GoodsSpecValue extends Model<GoodsSpecValue> {

    private static final long serialVersionUID=1L;

    /**
     * 产品规格ID
     */
    @TableId(value = "spec_value_id", type = IdType.AUTO)
    private Integer specValueId;

    /**
     * SKUID
     */
    private Integer skuId;

    /**
     * 商品ID
     */
    private Integer goodsId;

    /**
     * 属性名ID
     */
    private Integer propertyId;

    /**
     * 属性值ID
     */
    private Integer propertyValueId;

    /**
     * 是否SKU属性,0:否,1:是，默认0
     */
    private Integer isSku;


    @Override
    protected Serializable pkVal() {
        return this.specValueId;
    }

    @Override
    public String toString() {
        return "GoodsSpecValue{" +
        "specValueId=" + specValueId +
        ", skuId=" + skuId +
        ", goodsId=" + goodsId +
        ", propertyId=" + propertyId +
        ", propertyValueId=" + propertyValueId +
        ", isSku=" + isSku +
        "}";
    }
}
